<template>
    <view class="container">
        <u-grid :border="true" @click="changeGrid" col="2" :customStyle="GridStyle">
            <u-grid-item :name="baseListItem.id" :customStyle="ItemStyle"
                v-for="(baseListItem, baseListIndex) in baseList" :key="baseListIndex">
                <u-icon :customStyle="IconStyle" :name="baseListItem.name" :size="40"></u-icon>
                <text class="grid-text">{{ baseListItem.title }}</text>
            </u-grid-item>
        </u-grid>
    </view>
</template>

<script>
export default {
    data() {
        return {
            baseList: [{
                id: 1,
                name: 'more-circle-fill',
                title: '客户来源'
            },
            {
                id: 2,
                name: 'account-fill',
                title: '客户公海'
            },
            {
                id: 3,
                name: 'account',
                title: '客户私海'
            },
            {
                id: 4,
                name: 'plus-people-fill',
                title: '领取记录'
            },
            {
                id: 5,
                name: 'server-fill',
                title: '回访记录'
            },
            {
                id: 6,
                name: 'trash-fill',
                title: '客户回收站'
            },
            {
                id: 7,
                name: 'order',
                title: '课程订单'
            },
            {
                id: 8,
                name: 'file-text-fill',
                title: '商品订单'
            },
			{
			    id: 9,
			    name: 'chrome-circle-fill',
			    title: '课程订单回收站'
			},
			{
			    id: 10,
			    name: 'shopping-cart-fill',
			    title: '商城订单回收站'
			}
            ],
            GridStyle: {
                borderBottom: '1px solid #dadbde'
            },
            ItemStyle: {
                padding: '2em 0em'
            },
            IconStyle: {
                marginBottom: '.5em',
                color: "#19BC9C"
            },
            LoginUser: {}
        }
    },
    onLoad() {
        this.LoginUser = uni.getStorageSync('LoginUser') ? uni.getStorageSync('LoginUser') : {};
    },
    methods: {
        changeGrid(name)
        {
            let check = this.$u.auth.check()

            if(check === true)
            {
                switch (name) {
					case 1:
					    uni.navigateTo({
					        url:'/packageC/source/index'
					    })
					    break;
                    case 2:
                        uni.navigateTo({
                            url:'/packageA/highsea/index'
                        })
                        break;
					case 3:
					    uni.navigateTo({
					        url:'/packageB/privatesea/index'
					    })
					    break;
					case 4:
					    uni.navigateTo({
					        url:'/packageA/apply/index'
					    })
					    break;
                    case 5:
                        uni.navigateTo({
                            url:'/packageC/visit/index'
                        })
                        break;
					case 6:
					    uni.navigateTo({
					        url:'/packageB/reduction/index'
					    })
					    break;
					case 7:
					    uni.navigateTo({
					        url:'/packageC/suborder/index'
					    })
					    break;
					case 8:
					    uni.navigateTo({
					        url:'/packageB/proorder/index'
					    })
					    break;
					case 9:
					    uni.navigateTo({
					        url:'/packageC/suborder/recyclebin'
					    })
					    break;
					case 10:
					    uni.navigateTo({
					        url:'/packageB/proorder/recyclebin'
					    })
					    break;
                    default:
                        break;
                }
            }
        }
    },
}
</script>